package com.tuanzi.loan.web.lazy.system;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.service.system.RoleService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.system.RoleSearchRequest;
import com.tuanzi.loan.vo.response.system.RoleSearchResponse;

/**
 * @author Ray 2017/09/21
 */
public class RoleLazyDataModel extends BaseLazyDataModel<RoleSearchRequest, RoleSearchResponse> {

	private static final long serialVersionUID = 3707110210157606311L;

	@Autowired
	private RoleService roleService = SpringContextHolder.getBean(RoleService.class);

	public RoleLazyDataModel(RoleSearchRequest roleSearchRequest) {
		super(roleSearchRequest);
	}

	@Override
	protected Page<RoleSearchResponse> doLoad(PageSearcher<RoleSearchRequest> pageSearcher) {
		return roleService.list(pageSearcher);
	}
}
